package weituotian.com.testokhttp;

import android.support.test.runner.AndroidJUnit4;

import com.zhy.http.okhttp.OkHttpUtils;
import com.zhy.http.okhttp.callback.StringCallback;
import com.zhy.http.okhttp.log.LoggerInterceptor;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import java.util.concurrent.TimeUnit;

import okhttp3.Call;
import okhttp3.OkHttpClient;

/**
 * Created by Administrator on 2017-03-18.
 */

@RunWith(AndroidJUnit4.class)
public class TestOkhttp1 {

    @Before
    public void init() {
        OkHttpClient okHttpClient = new OkHttpClient.Builder()
//                .addInterceptor(new LoggerInterceptor("TAG"))
                .connectTimeout(10000L, TimeUnit.MILLISECONDS)
                .readTimeout(10000L, TimeUnit.MILLISECONDS)
                .addInterceptor(new LoggerInterceptor("TAG1"))
                //其他配置
                .build();

        OkHttpUtils.initClient(okHttpClient);
    }

    @Test
    public void testOKhttp01() throws InterruptedException {

        Thread.sleep(2000);
    }

}
